/**
 * 
 */
package com.maohi.software.arii.utils;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.name.Names;
import com.google.inject.util.Types;
import com.maohi.software.arii.annotations.ExtensionImpl;
import com.maohi.software.arii.annotations.JaxBImpl;
import com.maohi.software.arii.events.DependencyListener;
import com.maohi.software.arii.interfaces.Activator;
import com.maohi.software.arii.jaxb2.Plugin;
import com.maohi.software.arii.jaxb2.Plugin.ExtensionPoints.ExtensionPoint;
import com.maohi.software.arii.jaxb2.Plugin.Extensions.Extension;
import com.maohi.software.arii.jaxb2.Plugin.Jaxb.Xml;
import com.maohi.software.arii.jaxb2.Plugin.Jaxb.Xsd;

/**
 * @author heifara
 * 
 */
public class Keys {

	public static Key<List<Activator>> getListActivator() {
		return Key.get(TypeLiterals.getListActivator());
	}

	public static Key<List<DependencyListener>> getListDependencyListener() {
		return Key.get(TypeLiterals.getListDependencyListener());
	}

	@SuppressWarnings("rawtypes")
	public static Key getListExtension(Type aClass, String aId) {
		return Key.get(Types.listOf(aClass), ExtensionImpl.extension(aId));
	}

	@SuppressWarnings("rawtypes")
	public static Key getListJaxB(Class<?> aClass, String aId) {
		return Key.get(Types.listOf(aClass), JaxBImpl.jaxb(aId));
	}

	public static Key<List<Module>> getListModule() {
		return Key.get(TypeLiterals.getListModule());
	}

	public static Key<List<Module>> getListModuleOverride() {
		return Key.get(TypeLiterals.getListModule(), Names.named("override"));
	}

	public static Key<Map<Module, Module>> getMapModuleModule() {
		return Key.get(TypeLiterals.getMapModuleModule());
	}

	public static Key<Map<ExtensionPoint, List<Extension>>> getMapExtensionPointListExtension() {
		return Key.get(TypeLiterals.getMapExtensionPointListExtension());
	}

	public static Key<Map<String, List<Extension>>> getMapStringListExtension() {
		return Key.get(TypeLiterals.getMapStringListExtension());
	}

	public static Key<Map<String, List<ExtensionPoint>>> getMapStringListExtensionPoint() {
		return Key.get(TypeLiterals.getMapStringListExtensionPoint());
	}

	public static Key<Map<String, Plugin>> getMapStringPlugin() {
		return Key.get(TypeLiterals.getMapStringPlugin());
	}

	public static Key<Map<Xsd, List<Xml>>> getMapXsdListXml() {
		return Key.get(TypeLiterals.getMapXsdListXml());
	}

}
